
const Service = require('egg').Service;

class ArticleService extends Service {
  async find({start,limit}) {    //查询
    // var top250 = await this.ctx.model.Article.find({})
    var data = await this.ctx.model.Article.find({}).skip(Number(start)).limit(Number(limit));
    var total = await this.ctx.model.Article.find({}).count();
    return {data,total};
  }
  async findDetail(id) {    //删除
    // var top250 = await this.ctx.model.Top250.find({})
    var res = await this.ctx.model.Article.find({_id:id});
    // console.log(res)
    return res;
  }
  //累加增删改查
}

module.exports = ArticleService;
